package co.yixiang.modules.system.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.math.BigInteger;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @author db
* @date 2020-11-16
*/
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("g_withdraw")
public class Withdraw implements Serializable {

    @TableId
    private BigInteger id;


    /** 手机号码 */
    private String phone;


    /** 提现身份 */
    private String identity; // 提现身份, 1001:VIP/1002:商户/1003:合伙人

    @TableField(exist = false)
    private String identity_text;

    /** 提现类型 */
    private String type; // 提现类型, 1001:微信/1002:支付宝/1003:银行卡3

    @TableField(exist = false)
    private String type_text;

    /** 提现标题 */
    private String title;


    /** 提现金额 */
    private BigDecimal amount;


    /** 手续费 */
    private BigDecimal fee;


    /** 实际到账金额 */
    private BigDecimal actual;


    /** 提现名称 */
    private String name;


    /** 提现地址 */
    private String tos;


    /** 提现类型 */
    private Integer status;// 状态, 1001:待审核/1002:待提现/1003:取消/1004:完成/1005:失败

    @TableField(exist = false)
    private String status_text;

    /** 备注 */
    private String remark;


    /** 创建时间 */
    private LocalDateTime addTime;


    /** 修改时间 */
    private LocalDateTime updateTimes;


    public void copy(Withdraw source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
